import { Injector } from "@angular/core";
import { AppComponentBase } from "./app-component-base";


export abstract class AppModalComponentBase extends AppComponentBase{

    modalExpandOb = {
        className: '',
        isSmallEx: false,
        isFullScreen: false,
        modalExHandle:(_state: string) =>{
            if (_state === 'small') {
                if (!this.modalExpandOb.isSmallEx) {
                    this.modalExpandOb.className = 'modal-smallEx';
                    this.modalExpandOb.isSmallEx = true;
                    this.modalExpandOb.isFullScreen = false;
                } else {
                    this.modalExpandOb.className = '';
                    this.modalExpandOb.isSmallEx = false;
                }
            } else if (_state === 'full') {
                if (!this.modalExpandOb.isFullScreen) {
                    this.modalExpandOb.className = 'modal-fullEx';
                    this.modalExpandOb.isFullScreen = true;
                    this.modalExpandOb.isSmallEx = false;
                } else {
                    this.modalExpandOb.className = '';
                    this.modalExpandOb.isFullScreen = false;
                }
            }
        },
        resetStates:()=>{ 
            this.modalExpandOb.className = '';
            this.modalExpandOb.isFullScreen = false;
            this.modalExpandOb.isSmallEx = false;
        }
    }


    constructor(injector: Injector) {
        super(injector);
    }

}